package com.czk.model.decoratot.practice;

/**
 * @Author:ChenZhangKun
 * @Date: 2020/6/10 23:32
 */
public class DecoretorPre extends DrinkPra {
    // 聚合要装饰的啤酒
    private DrinkPra drinkPra;
    @Override
    float cost() {
        return getPrice()+drinkPra.cost();
    }
    // 通过构造方法注入
    public DecoretorPre(DrinkPra drinkPra) {
        this.drinkPra = drinkPra;
    }
    @Override
    public String getDes() {
        return super.getDes()+drinkPra.getDes();
    }
}
